package tmproject.hlhj.fhp.cartrans.presenter

import android.content.Context
import com.example.mymvp.BasePresenter
import tmproject.hlhj.fhp.cartrans.IView.ClassDetailView
import tmproject.hlhj.fhp.cartrans.javaBean.ClassDetailBean
import tmproject.hlhj.fhp.cartrans.javaBean.SaveClassBean
import tmproject.hlhj.fhp.cartrans.modules.ClassDetailModule

/**
 * Created by Never Fear   on 2018\8\28 0028.
Never More....
 */
class ClassDetailPresenter :BasePresenter<ClassDetailModule,ClassDetailView>(), ClassDetailModule.OnClassDetailListener {
    override fun createModule() {
        module= ClassDetailModule()
        module.listener=this
    }

    fun getClassDetail(id:Int,token:String?,c:Context){
        module?.getClassDetail(id, token, c)
    }
    fun saveClass(id: Int,token: String?,learned_time:String,c: Context){
        module.saveClass(id, token, learned_time, c)
    }
    override fun saveClassResp(saveClassBean: SaveClassBean) {
        view?.setSaveClassResult(saveClassBean)
    }

    override fun gotClassDetail(classDetailBean: ClassDetailBean) {

        view?.setDetailData(classDetailBean)
    }
}